package com.xyw.code.study202007291.functiontet;

import java.util.Optional;
import java.util.function.Function;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/7/30
 * Time: 上午10:32
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
public class OptionTest {
    public static void main(String[] args) {
        Integer a = 1;
        Integer b = 2;
        if(a.equals(b)){
            System.out.println("aaaa");
        }
        Optional<Integer> optional = Optional.of(1);
        System.out.println(optional.map(f -> f+1).get());
        Function<Integer,Optional<Integer>> function = x-> Optional.of(x+1);
        optional.flatMap(function).get();

    }
}
